package com.xie.mapper;

import com.xie.pojo.SysMessage;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface SysMessageMapper extends Mapper<SysMessage> {
    @Select("SELECT * FROM sys_message WHERE id IN " +
            "(SELECT mid FROM sys_msg_user smu LEFT JOIN `user` ON `user`.id = smu.uid " +
            "WHERE smu. STATUS = 0 " +
            "AND `user`.id = #{uid})")
    List<SysMessage> listMessageByUserId(Integer uid);
}
